
package im.agents.users;

import java.util.Vector;

import jade.core.Agent;
import jade.lang.acl.ACLMessage;
import jade.proto.ProposeInitiator;

public class SLAProposeInitiator extends ProposeInitiator {

	public SLAProposeInitiator(Agent a, ACLMessage msg) {
		super(a, msg);

	}

	@SuppressWarnings("unchecked")
	public String createConvId(Vector msgs){
		String token =Long.toString(
				java.util.Calendar.getInstance().getTimeInMillis());
		return myAgent.toString()+token;
	}
	
	protected void handleAcceptProposal(ACLMessage accepted){
		
		//System.out.println(accepted.getSender()+" ACCEPT-PROPOSAL");
		myAgent.addBehaviour(new WaitForSLAConfirm(
				myAgent,accepted.getConversationId()));
	}
}
